<!DOCTYPE html>
<html>
<head>
  <title>Blog</title>
  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= csrf_meta_tags %>
</head>
<body>
  <div id="header">
    <h1><%= link_to "Blog", root_path %></h1>
    <div id="user_bar">
      <% if logged_in? %>
        <%= link_to "New Article", new_article_path %> |
        <%= link_to "Edit Password", edit_user_path(current_user) %> |
        <%= link_to "Logout", logout_path %>
      <% else %>
        <%= link_to "Login", login_path %>
      <% end %>
    </div>
  </div>
  <div id="main">
    <%= content_tag :p, notice, class: 'notice' if notice.present? %>
    <%= content_tag :p, alert, class: 'alert' if alert.present? %>
    <%= yield %>
  </div>
  <div id="footer">
    A simple blog built for the book
    <a href="http://beginningrails.com">Beginning Rails 4 V2</a>
  </div>
</body>
</html>
